var FriendCon = iClass.get("Friend");
var UserCon = iClass.get("User");
var config = iClass.config;
iClass.method("Talk", {
	initInfo: function(info) {
		if (FriendCon.hasById(info.friend_id)) {
			this.friend_id = info.friend_id;
		}
		this.save();
	},
	setInfo:function (info) {
		info.content = String(info.content || "");
		if (!info.content) {
			Throw("聊天内容不可为空")
		}
		if (info.content.length > config.talkContentMaxLength) {
			Throw("单条聊天内容长度过长，请分段发送")
		}
		this.content = info.content;
		this.save();
	}
})